<html>
    <head>
        <title>TestPage</title>
        <script src="js/G2D.js" type="text/javascript"></script>

        <script type="text/javascript">
            var ImgStatic;
            var CanvasStatic;
            function pageLoad()
            {
                var ctx = new G2D.Drawable.CanvasUnit("MainFrame",600,400);
                var img = new G2D.Drawable.ImgUnit("images/1.png",ctx);
                img.setSpeed(10,10);
                img.move();
                img.draw();
                ImgStatic = img;
                CanvasStatic = ctx;
            }
            function MoveImg()
            {
                CanvasStatic.Clear();
                ImgStatic.move();
                ImgStatic.draw();
            }
        </script>
    </head>
    <body onload="pageLoad()">
        <div id="MainFrame"></div>
        <input type="button" text="Press me" value="Press me" onclick="MoveImg()">
    </body>
</html>